<template>
  <el-input-number
    class="cz-input-number"
    style="width: 100%"
    :controls="controls"
    :value="num"
    @input="$emit('input', $event)"
  ></el-input-number>
</template>

<script>
export default {
  name: "CzInputNumber",
  props: {
    value: [String, Number],
    controls: {
      type: Boolean,
      default: false,
    },
  },
  computed: {
    num() {
      return typeof this.value === "number" ? this.value : undefined;
    },
  },
};
</script>

<style lang="less" scoped>
.cz-input-number {
  ::v-deep .el-input__inner {
    text-align: left;
  }
}
</style>